<!--考勤调整面板-->
<template>
  <div class="edit-dialog">
    <el-dialog
      title="考勤调整"
      :visible.sync="dialogVisible"
      width="45%"
      :before-close="handleClose"
      :show-close="false"
    >
      <el-form :model="form" ref="form" inline size="mini" label-width="80px">
        <el-form-item prop="morning" label="早上上班">
          <el-select v-model="form.morning" clearable>
            <el-option
              v-for="(v, k) in signResultOptions"
              :key="k"
              :value="v.value"
              :label="v.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="afternoon" label="中午上班">
          <el-select v-model="form.afternoon" clearable>
            <el-option
              v-for="(v, k) in signResultOptions"
              :key="k"
              :value="v.value"
              :label="v.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="night" label="下午上班">
          <el-select v-model="form.night" clearable>
            <el-option
              v-for="(v, k) in signResultOptions"
              :key="k"
              :value="v.value"
              :label="v.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="downwork" label="下班">
          <el-select v-model="form.downwork" clearable>
            <el-option
              v-for="(v, k) in signResultOptions"
              :key="k"
              :value="v.value"
              :label="v.label"
            ></el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="cancel">取 消</el-button>
        <el-button type="primary" @click="confirm" :loading="loading"
          >确 定</el-button
        >
      </span>
    </el-dialog>
  </div>
</template>

<script>
import { signResultOptions } from "@/assets/js/const.js";
export default {
  props: {
    dialogVisible: {
      type: Boolean,
      default: false
    },
    loading: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      form: {},
      signResultOptions
    };
  },
  methods: {
    handleClose() {},
    cancel() {
      this.$emit("cancel");
    },
    confirm() {
      this.$emit("confirm", this.form);
    }
  }
};
</script>
